/**
 * Created by Administrator on 2017/5/6 0006.
 */
    checkCookie()
    var mid= $.cookie('mid')
    var token= $.cookie('token')
var next_page='';
var data_back=false;
$(window).scroll(function () {
    var windowheight=$(window).height();//窗口高度
    var scrolltop=$('body').scrollTop();//滚动条高度
    var eh=$(document).height();//文本高度
    if(eh==windowheight+scrolltop){
        $('.bot_loading').show()
            if(data_back){
                return false
            }
                data_back=true
                if(next_page==null)
                {
                    $('.bot_loading').html('没有更多啦！');
                    setInterval(function () {
                        $('.bot_loading').fadeOut(800)
                    },2000);
                    next_page=false;
                }
                else{
                    getData({url:next_page,data:{mid:mid,token:token}}, function (data) {
                        var html=template('list',data);
                        $('.list').append(html)
                        $('.bot_loading').hide();
                        next_page=data.next_page_url;
                        data_back=false;
                    })
                }
    }else{
        $('.bot_loading').hide()
    }
})
getData({url:news,data:{mid:mid,token:token}}, function (data) {
    var html=template('list',data);
    $('.list').html(html);
    $('.load').hide();
    next_page=data.next_page_url
})